package com.roncoo.education.course.service.api;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.roncoo.education.course.common.dto.CourseAppointmentDTO;
import com.roncoo.education.course.common.req.CourseAppointmentREQ;
import com.roncoo.education.course.service.api.biz.ApiCourseAppointmentBiz;
import com.roncoo.education.util.base.BaseController;
import com.roncoo.education.util.base.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping(value = "/course/api/appointment")
@Api(tags = "查看预约课程")
public class ApiCourseAppointmentController extends BaseController {

    @Autowired
    private ApiCourseAppointmentBiz biz;

    @ApiOperation(value = "用户查看预约课程")
    @RequestMapping(value = "/list",method = RequestMethod.POST)
    public Result<Page<CourseAppointmentDTO>>list(@RequestBody CourseAppointmentREQ req){
        Long userNo=this.getUserNo();
        if(!userNo.equals(req.getUserNo())){
            Result.error("用户信息错误");
        }
        return biz.getCourseAppointmentIntroduce(req);

    }

}
